<include file="Public:header" />
<h3 class="title"><em>新增图片广告</em><include file="nav" /></h3>
<div class="formbox">
<form name="mform" method="post" action="{:U('add')}" enctype="multipart/form-data">
  <table width="100%" border="0" cellspacing="1" cellpadding="0">
    <tr>
      <th>广告名称：</th>
      <td><input name="name" type="text" class="ipt" id="name" size="50" maxlength="50" value="" /></td>
    </tr>
    <tr>
      <th>图片：</th>
      <td><script type="text/javascript">
					KindEditor.ready(function(K) {
						var editor = K.editor({
							allowFileManager : true,
							uploadJson : "{:U('/Common/uploadEditor')}"
						});
						K('#imageBtn').click(function() {
							editor.loadPlugin('easyimage', function() {
								editor.plugin.imageDialog({
									//imageUrl : K('#url1').val(),
									clickFn : function(url, title, width, height, border, align) {
										//K('#url1').val(url);
										$("#imageUrl img").attr({src:url, alt:title});
										 $("#pic").val(url);
										$("#imageUrl").show();
										editor.hideDialog();
									}
								});
							});
						});
					});
				</script> 
        <div id="imageUrl" class="imageUrl" 
        <notempty name="info['pic']">style="display:block;"</notempty>
        >
        <empty name="info['pic']"> <img align="absmiddle" width="100" />
          <else/>
          <img align="absmiddle" width="100" src="{$info['pic']}" /> </empty>
      </div>
    
    <div class="clear"></div>
      <input type="text" name="pic" class="ipt" id="pic" value="{$info['pic']}" class="ipt" size="30" />
    <input type="button" id="imageBtn" value="插入图片" />
      </td>
    
      </tr>
    
    <tr>
      <td align="right">图片广告链接</td>
      <td><input type="text" class="ipt" name="pic_url" id="pic_url" size="30" maxlength="100" /></td>
    </tr>
    <tr>
      <td align="right">图片广告标题</td>
      <td><input type="text" class="ipt" name="pic_title" id="pic_title" size="30" maxlength="100" /></td>
    </tr>
    <tr>
      <td align="right">备注</td>
      <td><textarea rows="3" cols="42" name="remark" id="remark" class="ipt"></textarea></td>
    </tr>
    <tr>
      <td align="right">nofollow</td>
      <td><label>
          <input name="nofollow" type="radio" value="1" />
          是</label>
        &nbsp;&nbsp;&nbsp;
        <label>
          <input name="nofollow" type="radio" value="2" checked="checked" />
          否</label></td>
    </tr>
    <tr>
      <th>状态：</th>
      <td><label>
          <input name="status" type="radio" value="1" checked="checked" />
          显示</label>
        <label>
          <input name="status" type="radio" value="2" />
          不显示</label></td>
    </tr>
    <tr class="btnbox">
      <th>&nbsp;</th>
      <td><input type="hidden" value="1" name="ad_type" />
        <input type="submit" class="btn" value="保 存">
        &nbsp;
        <input type="reset" class="btn" value="取 消" onClick="window.location.href='{:U('index')}';"></td>
    </tr>
  </table>
</form>
</div>
<include file="Public:footer" />